<%@ page pageEncoding="UTF-8" %>
<!doctype html>
<html lang="zh-cmn">
<head>
    <title>Document</title>
    <%@include file="/WEB-INF/jsp/header.jsp"%>
</head>
<body>
    <div class="container-fluid">
        <div class="panel panel-info">
            <div class="panel-heading">
                <h3 class="panel-title">
                    信息查询
                </h3>
            </div>
            <div class="panel-body">
                <form class="form-inline" method="post" id="DrugstockForm">
                    <div class="form-group">
                        <label for="">药品名称:</label>
                        <input type="text" id="demo" value="" data-provide="typeahead" name="drugName" class="form-control" />

                    </div>
                    <button type="button" onclick="searchByWhere()" class="btn btn-info">搜索</button>
                </form>
            </div>
            <table  id="drugstockTable"
                    data-toggle="table"
                    data-url="${ctx}/stock/search"
                    data-toolbar="#toolbar"
                    data-striped="true"
                    data-pagination="true"
                    data-side-pagination="server"
                    data-page-list="[5,10,15,30]"
                    data-smart-display="true"
                    data-click-to-select="true"
            >
                <thead>
                <tr>

                    <th data-field="druginfo.drugName">药品名称</th>
                    <th data-field="druginfo.drugStandard">药品规格</th>
                    <th data-field="druginfo.drugUnit">药品单位</th>
                    <th data-field="druginfo.drugPreparation">药品剂型</th>
                    <th data-field="stoPcs">库存数量</th>
                    <th data-field="druginfo.drugFloor">库存下线</th>
                    <th data-formatter="optEvent" data-events="optEvents">操作</th>
                </tr>
                </thead>
            </table>
        </div>

    </div>
<%@include file="/WEB-INF/jsp/footer.jsp"%>
<script src="${ctx}/res/js/Drugstock.js"></script>
<script src="${ctx}/statics/js/bloodhound.min.js"></script>
    <script src="${ctx}/statics/js/typeahead.bundle.min.js"></script>
    <script src="${ctx}/statics/js/typeahead.jquery.min.js"></script>
    <%--<script>
        /*** 3.Ajax及时获取数据示例 ***/
            //远程数据源
        var remote_cities = new Bloodhound({
                datumTokenizer: Bloodhound.tokenizers.obj.whitespace('drug_name'),
                queryTokenizer: Bloodhound.tokenizers.whitespace,
                // 在文本框输入字符时才发起请求
                remote: '${ctx}/stock/searchByName'
            });
        remote_cities.initialize();
        $('#demo').typeahead({
                hint: true,
                highlight: true,
                minLength: 1
            },
            {
                name: 'searchByName',
                displayKey: 'drugName',
                source: remote_cities.ttAdapter(),
            });
    </script>--%>
</body>
</html>
